#pragma once
#include <gfx/dx12/descriptor_heap.h>
#include <gfx/dx12/queue.h>

namespace primal
{
	namespace gfx
	{
		struct DxLevel
		{
			constexpr DxLevel(D3D_FEATURE_LEVEL l, const wchar_t* n) :level{ l }, name{ n }
			{}
			DxLevel() = default;
			D3D_FEATURE_LEVEL level;
			const wchar_t* name;
		};

		enum PipelineType
		{
			Debug,
			DeferredShading,
			MAX_PIPELINE
		};

		struct pipeline_info
		{
			ID3D12PipelineState* pipeline;
			ID3D12RootSignature* root_signature;
		};

		bool initialize();
		void shutdown();
		ID3D12Resource* create_rtv_srv(u32 width, u32 height, descriptor_handle& rtv, descriptor_handle& srv);
		ID3D12DeviceN* device();
		IDXGIFactoryN* factory();
		DirectQueue& direct_queue();
		CopyQueue& copy_queue();
		SRVDescriptorHeap& srv();
		RTVDescriptorHeap& rtv();
		DSVDescriptorHeap& dsv();
		DxLevel get_level();
		pipeline_info& get_pipeline(PipelineType type);
	}
}